import com.google.java.contract.*;

@Invariant("getLength() > 0")
public class Part {
	
	float x;
	float y;
	float z;
	private float length;
	private float friction;
	private boolean pull;
	
	//private float 
	
    //o curvature
	
	@Requires("sLength > 0")
	public Part(float sLength, float sFriction, boolean sPull) {
		if (sLength < 10) {
			length = 10;
		} else {
			length = sLength;
		}
		friction = sFriction;
		pull = sPull;
	}
	
	public float getLength() {
		return length;
	}
	
	public float getFriction() {
		return friction;
	}
	
	public boolean getPull() {
		return pull;
	}
	
	@Requires("newLength > 0")
	@Ensures("getLength() == newLength")
	public void setLength(float newLength) {
		length = newLength;
	}
	
	@Requires("newFriction >= 0")
	@Ensures("getFriction() == newFriction")
	public void setFriction(float newFriction) {
		friction = newFriction;
	}
	
	@Requires("newPull == true || newPull == false")
	@Ensures("getPull() == newPull")
	public void setPull(boolean newPull) {
		pull = newPull;
	} 

}
